import sys
import torch
if __name__ == '__main__':
    # recognize_car_num("苏A7L0C6","input7.mp4")
    # 加载YOLOv5模型
    # 添加第一个路径
    sys.path.append('./recognizer')

    # 从第一个路径加载模型
    model = torch.hub.load('recognizer/', 'custom', path='recognizer/yolov5s.pt', source='local')

    # 删除第一个路径
    sys.path.remove('./recognizer')

    # 添加第二个路径
    sys.path.append('./recognizer_car_num')

    # 从第二个路径加载模型
    model = torch.load('recognizer_car_num/weights/plate_detect.pt', map_location=None)['model'].float().fuse().eval()

    # 删除第二个路径
    sys.path.remove('./recognizer_car_num')